package com.zjj.learn.designmodel.work.factory.method_factory;

public class CoffeeShop {

    /**
     * 咖啡店必须有工厂才能够制作咖啡
     **/
    private CoffeeFactory factory;

    public CoffeeFactory getFactory() {
        return factory;
    }

    public void setFactory(CoffeeFactory factory) {
        this.factory = factory;
    }

    /**
     * 制作咖啡
     **/
    public Coffee order(){
        Coffee coffee = factory.makeCoffee();
        coffee.addNai();
        coffee.addTang();
        return coffee;
    }
}
